package com.heipi.myliteflow.controller;

import com.yomahub.liteflow.core.FlowExecutor;
import com.yomahub.liteflow.flow.LiteflowResponse;
import com.yomahub.liteflow.slot.DefaultContext;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: honry.guan
 * @create: 2025-07-21 16:51
 **/
@RestController
@RequestMapping("/test")
public class FlowTestController {
    @Resource
    private FlowExecutor flowExecutor;

    @GetMapping("/flowTest")
    public String flowTest() {
        LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg", DefaultContext.class);
        return response.getMessage();
    }
}
